#ifndef _SCHEDULER_H_
#define _SCHEDULER_H_

#include <queue>
#include <set>
#include <boost/date_time.hpp>
#include <boost/thread.hpp>

namespace scheduler
{
using namespace std;
using namespace boost;

typedef int (*SCHEDULE_HANDLE)();

struct HANDLE_INFO
{
	// next time this handle will be call.
	time_t nextTriggerTime;

	// for handle only run once, this should be 0;
	time_t cyclel;

	SCHEDULE_HANDLE handle;

};

class Scheduler: public noncopyable
{
public:
	Scheduler();
	virtual ~Scheduler();
	virtual void exec();
	virtual void quit();
	virtual void exit(int value);
private:
	typedef priority_queue<SCHEDULE_HANDLE> HandleQueue;
	HandleQueue handleQueue;
	//set
	//list
}; // class Scheduler

}; // namespace scheduler

#endif // _SCHEDULER_H_